<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>结算记录管理</title>
	<meta name="decorator" content="default"/>
	<link href="${ctxStatic}/jquery-select2/3.4/select2.min.css" rel="stylesheet" />
	<script src="https://select2.github.io/vendor/js/jquery.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
	<script src="${ctxStatic}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$(".js-example-basic-single").select2();
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
		function excel(){
			$('#searchForm').attr('action',"${ctx}/jiujiu/jiuSettleAccountsLog/excel");
			$('#searchForm').submit();
		}
		function search(){
			$('#searchForm').attr('action',"${ctx}/jiujiu/jiuSettleAccountsLog");
			$('#searchForm').submit();
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/jiujiu/jiuSettleAccountsLog/">结算记录列表</a></li>
		<shiro:hasPermission name="jiujiu:jiuSettleAccountsLog:edit"><li><a href="${ctx}/jiujiu/jiuSettleAccountsLog/form">结算记录添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="jiuSettleAccountsLog" action="${ctx}/jiujiu/jiuSettleAccountsLog/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>订单号：</label><form:input path="orderNo" htmlEscape="false" maxlength="50" class="input-medium"/>
		
		<label>门店名称 ：</label>
		<form:select path="storeId" class="js-example-basic-single">
			<form:option value="">全部</form:option>
			<c:forEach items="${JiuStoreList}" var="jiuStore">
                   <form:option value="${jiuStore.id}">${jiuStore.name}</form:option>
			</c:forEach>
       	</form:select>
		
		
		<label>厂家名称 ：</label>
		<form:select path="manufactorId" class="js-example-basic-single">
			<form:option value="">全部</form:option>
			<c:forEach items="${jiuManufactorList}" var="jiuManufactor">
                   <form:option value="${jiuManufactor.id}">${jiuManufactor.name}</form:option>
			</c:forEach>
       	</form:select>
       	
       	 </br>
       	<label>结算时间 ：</label>
				<input id="startTime" name="startTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
						value="<fmt:formatDate value="${jiuSettleAccountsLog.startTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/> -至-
						
				<input id="endTime" name="endTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
						value="<fmt:formatDate value="${jiuSettleAccountsLog.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/> 
						
		&nbsp;<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="javascript:search()"/>
		&nbsp;<input class="btn btn-primary" type="button" value="导出" onclick="javascript:excel()"/>
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead><tr>
		<th>厂家名称</th>
		<th>门店名称</th>
		<th>订单号</th>
		<th>结算积分</th>
		<th>备注</th>
		<th>结算时间</th>
		<shiro:hasPermission name="jiujiu:jiuSettleAccountsLog:edit"><th>操作</th></shiro:hasPermission></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="jiuSettleAccountsLog">
			<tr>
				<td>${jiuSettleAccountsLog.name}</td>
				<td>${jiuSettleAccountsLog.storeName}</td>
				<td><a href="${ctx}/jiujiu/jiuOrder?orderNo=${jiuSettleAccountsLog.orderNo}">${jiuSettleAccountsLog.orderNo}</a></td>
				<td>${jiuSettleAccountsLog.point}</td>
				<td>${jiuSettleAccountsLog.remarks}</td>
				<td><fmt:formatDate value="${jiuSettleAccountsLog.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss" /></td>
				<shiro:hasPermission name="jiujiu:jiuSettleAccountsLog:edit"><td>
    				<a class="btn btn-success" href="${ctx}/jiujiu/jiuSettleAccountsLog/form?id=${jiuSettleAccountsLog.id}">修改</a>
					<a class="btn btn-danger" href="${ctx}/jiujiu/jiuSettleAccountsLog/delete?id=${jiuSettleAccountsLog.id}" onclick="return confirmx('确认要删除该结算记录吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		<tr>
			<td>--</td>
			<td>--</td>
			<td>--</td>
			<td>${map.pointSum}</td>
			<td>--</td>
			<td>--</td>
		</tr>
		
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
